package cn.lingyangwl.framework.security.ratelimit;

import cn.lingyangwl.framework.core.response.Resp;
import cn.lingyangwl.framework.security.ratelimit.LimitTypeEnum;
import cn.lingyangwl.framework.security.ratelimit.RateLimit;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shenguangyang
 */
@RestController
@RequestMapping("/rate_limit")
public class RateLimitController {

    @RateLimit(key = "test", time = 10, count = 10, limitType = LimitTypeEnum.IP)
    @GetMapping("/get")
    public Resp<?> test() {
        return Resp.ok();
    }
}
